<template>
  <div class="register">
    <info :ruleForm="contextInfo" @on-behavior="onRegist" />
  </div>
</template>

<script lang="ts">
import { reactive } from "vue";
import info, { ContextProps } from "../components/ReInfo/index.vue";
// import { getRegist } from "/@/api/user";
import { useRouter } from "vue-router";
// import { warnMessage, successMessage } from "/@/utils/message";
export default {
  name: "register",
  components: {
    info
  },
  setup() {
    const router = useRouter();

    const contextInfo: ContextProps = reactive({
      userName: "",
      passWord: "",
      identify: ""
    });

    // 注册
    const onRegist = async () => {
      // let { userName, passWord } = contextInfo;
      // let { code, info } = await getRegist({
      //   username: userName,
      //   password: passWord
      // });
      // code === 0
      //   ? successMessage(info) && router.push("/login")
      //   : warnMessage(info);
    };

    return {
      contextInfo,
      onRegist,
      router
    };
  }
};
</script>
